package GUIPanels;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.JPanel;

import World.World;


public class HUDPanel extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	Font extinctionFont = new Font("TimesRoman", Font.BOLD,  32);
	Font hudText = new Font("TimesRoman",Font.BOLD,14);
	
	public void paintComponent(Graphics g)
	{
		g.setFont(hudText);
		g.setColor(Color.blue);
		g.drawString("Year:"+(int)World.pop.getYear() + "   Month:" + (int)World.pop.getMonth(), 5, 5+hudText.getSize());
		if(World.pop.getLength() == 0)
		{ // EXTINCTION
			g.setColor(Color.black);
			g.fillRect(getWidth()/2 - extinctionFont.getSize() * 2-7, getHeight()/2-extinctionFont.getSize()/2, extinctionFont.getSize() * 4+34, extinctionFont.getSize() + 10);
			g.setFont(extinctionFont);
			g.setColor(Color.red);
			g.drawString("Extinction",getWidth()/2 - extinctionFont.getSize() * 2,getHeight()/2+extinctionFont.getSize()/2);
		}
	}
	
	public void Alert(String text)
	{
		Graphics g = this.getGraphics();
		g.setFont(hudText);
		g.setColor(Color.blue);
		g.drawString(text, 5, 5+2*hudText.getSize()+2);
	}
	
	public void DisplayInhabitantData()
	{
		
	}
	
}